package com.gjy.sb.disruptor;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.UUID;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-08-19 21:51:30
 */
@RestController
@RequestMapping("disruptor")
public class OrderController {

    @Resource
    private OrderService orderService;

    @GetMapping("/create")
    public String createOrder() {
        String orderId = "ORD-" + UUID.randomUUID().toString().substring(0, 8);
        orderService.createOrder(orderId, "iPhone 15", 1, 9999.0);
        return "订单 " + orderId + " 已提交处理！";
    }

}
